global replica_dir="<add path to your working directory>"
global data_dir="$replica_dir/data"
global output_dir="$replica_dir/output"

use "$data_dir/slvl_fin.dta", clear 


	
/*----------------------------------------------------------------------------*/
 

la var gender_tm1  "Teacher men, baseline"
la var tit_educ_tm1 "Education degree, baseline"
la var municip_tm1 "Municipal school, baseline"
la var rural_rbd_tm1 "Rural school, baseline"
la var multsch_tm1 	"Teach in multiple schools, baseline" 
la var tea_admin_tm1 "Administrative duties primarily, baseline"

la var horas_contrato_tm1 	"Contract hours, baseline"
la var tea_classhrs_tm1  	"Classroom teaching hours, baseline"
 
la var dropped_tm1  "Turnover: Lagged attrition, baseline"
la var newtea_tm1    "Turnover: Prop. new teachers, baseline"
la var exp_tm1   	"Teacher experience, baseline"
la var aep10_tm1  	"Prop. AEP certified, baseline"

la var treat25 "Full vs. Partial Bonus"
la var treat10 "Partial vs. No Bonus"

la var st_ind25 "100% vs. 60%"
la var st_ind10 "60% vs. none"



/*----------------------------------------------------------------------------*/

**# Figure A5. Teachers' baseline variables discontinuity plots

/*----------------------------------------------------------------------------*/



global indepvars "municip_tm1 rural_rbd_tm1 gender_tm1 tit_educ_tm1 permanent_tm1 tea_admin_tm1 multsch_tm1 horas_contrato_tm1 tea_classhrs_tm1 dropped_tm1 newtea_tm1 exp_tm1 aep10_tm1"
 
foreach i in 10 25{

local label_st_ind`i': variable label st_ind`i'

	foreach y of global indepvars{

	local label_`y': variable label `y'
	
	rdplot `y' st_ind`i'  if abs(st_ind`i')<=1.5, h(1.5) ///
	graph_options(legend(off) graphregion(color(white)) ///
	xtitle("SNED index centered at zero") ///
	title("`label_`y'', `label_st_ind`i''") )   ///
	xlab(-1.5(0.5)1.5)  binselect(esmv)  kernel(uni) p(2) masspoints(off)
	
	graph export  "$output_dir/graph_t_`y'_`i'.png" , as(png) replace

	} 
}







